package third;

public class Company {
    private Employee[] employees;
    int size;

    public Company(Employee[] employees, int size) {
        this.employees = employees;
        this.size = size;
    }

    public void addEmployee(Employee employee) {
        this.employees[size++] = employee;
    }

    public double calculate(Employee[] employees, int size) {
        double total = 0;
        for(int i = 0; i < size; i++) {
            total += employees[i].earnings();
        }
        return total;
    }
}
